package org.example;

//一个KVPair对象代表一个键值对
//为了让KVPair(键值对)能够进行排序，我们让KVPair类implements(实现)Comparable接口
public class KVPair  implements Comparable<KVPair>{
    String key;
    String value;

    public KVPair(String key,String value) {
        this.key=key;
        this.value=value;
    }

    public String read_key(){
        return key;
    }

    public String read_value(){
        return value;
    }

    @Override
    public int compareTo(KVPair another) {
        return this.key.compareTo(another.key);
    }

}
